﻿using System.Linq;
using System.Web.Mvc;
using Concordia.Models._AccountInfo;
using Concordia.ViewModels;

namespace Concordia.Controllers
{
    public class _AccountInfoController : Controller
    {
        //
        // GET: /_AccountInfo/
        public ActionResult AccountPanel()
        {
            //TODO:  Redirect login
            if (Session == null) return View();
            
            var vm = (AccountViewModel) Session["AccountViewModel"];
            var context = new _AccountInfoDataContext();
            var result = context.WEB_SEL_CS_MAIN_ACCOUNT(vm.LoanKey).FirstOrDefault();

            return View(result);
        }

    }
}
